package com.tuzhi.auth.sys.web.controller;

import com.tuzhi.auth.sys.service.SysDictionaryService;
import com.tuzhi.base.web.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/sys/dict")
@Api(tags = "数据字典")
public class SysDictionaryController {

    @Autowired
    SysDictionaryService sysDictionaryService;

    @ApiOperation(value = "根据类型获取数据项")
    @GetMapping(value = {"/list/{dicName}"})
    public Result<List> list4DicName(@PathVariable(value = "dicName", required = true) String dicName) {
        Result result = new Result();
        result.setCode("0");
        result.setData(sysDictionaryService.list4DicName(dicName));
        return result;
    }


}
